<template>
  <label>
    <input ref="editor" style="width: 500px" :value="model" @input="model = $event.target.value"/>{{ model }}
  </label>
</template>

<script>

export default {
  name: "Editor",
  props: {
    value: {
      type: String
    }
  },
  methods: {
    change(event) {
      this.$emit('update:value', event.target.value)
    },
  },
  watch: {
    model: {
      handler: function (newValue, oldvalue) {
        this.$emit('update:value', newValue)
      },
    }
  },
  data() {
    return {
      model: 'aaa'
    }
  },
}
</script>

<style scoped>

</style>
